/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2023. All rights reserved.
 */

package model

import "time"

/*
* OrderId 平台订单号
* PlatformType 平台类型,1为云上包周期订单,2为平台包周期订单
* CloudOrderId 云上订单号,仅当PlatformType为1时有效,同一个云上订单号下有可能会有多条账单
* UserId 平台用户ID
* CloudUserId 云上用户ID
* CreatedId 辅助CreatedTime排序的索引
* CreatedTime 系统订单创建时间
* Currency 币种,CNY
* OriginAmount 订单原始金额
* PaymentAmount 订单实际支付金额
* CouponId 订单使用的优惠券ID
* OrderType 订单类型： 1：开通2：续订3：变更4：退订11：按需转包年/包月13：试用14：转商用15：费用调整
* OrderStatus 订单支付状态，和云上订单支付状态一致，仅包周期订单有效,1待审核，3处理中，4已取消，5已完成，6待支付，9待确认
* OrderExpiredTime 系统订单失效时间，仅包周期订单有效
* ResourceId 按需资源ID,云上资源为云上资源ID，自有资源为平台生成ID
* ResourceExpiredTime 资源失效时间，包周期订单资源失效时间
* PaymentTime 系统订单支付时间，仅包周期订单有效
* ServiceTypeCode 云服务类型编码
* ServiceTypeName 云服务类型名称
* ProductionSpecDesc 产品规格描述
 */
type OnePayOrder struct {
	OrderId             string    `orm:"column(order_id);size(64);index"`
	PlatformType        string    `orm:"column(platform_type);size(10)"`
	CloudOrderId        string    `orm:"column(cloud_order_id);size(64);"`
	UserId              string    `orm:"column(user_id);size(64);"`
	CloudUserId         string    `orm:"column(cloud_user_id);size(64);"`
	CreatedId           int32     `orm:"column(created_id);auto;index;type(int)"`
	CreatedTime         time.Time `orm:"column(created_time);auto_now_add;size(datetime)"`
	ResourceId          string    `orm:"column(resource_Id);size(64)"`
	ResourceExpiredTime time.Time `orm:"column(resource_expired_time);size(datetime)"`
	OrderExpiredTime    time.Time `orm:"column(order_expired_time);size(datetime)"`
	Currency            string    `orm:"column(currency);size(8)"`
	OriginAmount        float64   `orm:"column(origin_amount);digits(17);decimals(2)"`
	PaymentAmount       float64   `orm:"column(payment_amount);digits(17);decimals(2)"`
	CouponId            string    `orm:"column(coupon_id);size(64);"`
	OrderType           int32     `orm:"column(order_type);type(int)"`
	OrderStatus         int32     `orm:"column(order_status);type(int)"`
	PaymentTime         time.Time `orm:"column(payment_time);size(datetime)"`
	ServiceTypeName     string    `orm:"column(service_type_name);size(32)"`
	ServiceTypeCode     string    `orm:"column(service_type_code);size(32)"`
	ProductionSpecDesc  string    `orm:"column(production_spec_desc);size(512)"`
}
